#ifndef FILEDOWNLOADREQUESTSENDERPROCESS_H_
#define FILEDOWNLOADREQUESTSENDERPROCESS_H_

#include <string>
#include <list>
#include <string.h>
#include <algorithm>
#include "Constants.h"
#include "Process.h"
#include "SharedRecord.h"
#include "SharedFile.h"
#include "RequestFifo.h"
#include "FileDownloaderProcess.h"

using namespace std;

class FileDownloadRequestSenderProcess: public Process {

private:
	static int downloadsCounter;
	string downloadDirectory;
	list<string> files;

	static string getUniqueDownloadFifoName();
	bool sendRequest(string fifoReceptor, SharedRecord requestToSend);

public:
	FileDownloadRequestSenderProcess(LogFile* logFile);
	virtual ~FileDownloadRequestSenderProcess();

	void setDownloadDirectory(string downloadDirectory);
	void setFiles(list<string> files);

protected:
	virtual int doWork();
	virtual string getProcessName();
};

#endif /* FILEDOWNLOADREQUESTSENDERPROCESS_H_ */
